package springboot.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import springboot.bean.Euser;
import springboot.bean.Tuser;
import springboot.mapper.TuserMapper;
import springboot.service.TuserService;

@Service("tuserService")
public class TuserServiceImpl implements TuserService {
	@Autowired
	private TuserMapper TuserMapper;
	@Override
	public Tuser getUserName(String username) {
		return TuserMapper.username(username);
	}
	@Override
	public boolean reg(String username, String password) {
		return TuserMapper.reg(username, password);
	}
	@Override
	public boolean update(String username, String password, Integer id) {
		return TuserMapper.update(username, password, id);
	}
	@Override
	public boolean imgLocalhos(Integer id,String img_localhost) {
		return TuserMapper.imgLocalhost(img_localhost,id);
	}
	@Override
	public String imgToView(String username) {	
		String aa=TuserMapper.username(username).getImg_localhost();
		return aa;
	}
	@Override
	public List<Euser> users() {
		return TuserMapper.euser();
	}
	@Override
	public boolean excelis(String name) {
		Euser isuser=TuserMapper.iseuser(name);
		if (isuser==null) {
			return false;
		}
		return true;
	}
	@Override
	public boolean excelin(String name, String address, String note) {
		return TuserMapper.excelin(name, address, note);
	}
	@Override
	public boolean excelup(String address, String note, String name) {
		return TuserMapper.excelup(address, note, name);
	}
}
